<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
</body>
<script>
    class Father{
        constructor(a,b){
            this.a = a;
            this.b = b;
            this.c = 5;
            this.d = 6;
        }
        add(){
            console.log(this.a + this.b);
        }
        sub(){
            console.log(this.c + this.d);
        }
    }
    Father.prototype.sum = function(){
        console.log(this.d - this.c);
    }
    let ldh = new Father(1,2);
    class Son extends Father{
        constructor(){
            super(3,4)
        }
    }
    let zxy = new Son();
    zxy.add();
    zxy.sub();
    zxy.sum();
</script>
</html>